/**
 * 
 */
package dataStructures;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.Writable;

/**
 * @author zvikadori
 *
 */
public class ErrorElementWritable implements Writable {
	private int profileSampleSize;
	private long totalSquareError;
	
	/* (non-Javadoc)
	 * @see org.apache.hadoop.io.Writable#write(java.io.DataOutput)
	 */
	@Override
	public void write(DataOutput out) throws IOException {
		out.writeInt(profileSampleSize);
		out.writeLong(totalSquareError);

	}

	/* (non-Javadoc)
	 * @see org.apache.hadoop.io.Writable#readFields(java.io.DataInput)
	 */
	@Override
	public void readFields(DataInput in) throws IOException {
		profileSampleSize = in.readInt();
		totalSquareError = in.readLong();

	}
	
	public static ErrorElementWritable read(DataInput in) throws IOException {
		ErrorElementWritable w = new ErrorElementWritable();
		w.readFields(in);
		return w;

	}

	public int getProfileSampleSize() {
		return profileSampleSize;
	}

	public void setProfileSampleSize(int profileSampleSize) {
		this.profileSampleSize = profileSampleSize;
	}

	public long getTotalSquareError() {
		return totalSquareError;
	}

	public void setTotalSquareError(long totalSquareError) {
		this.totalSquareError = totalSquareError;
	}
	
	

}
